package com.woniu.microownerserver.controller;

import com.woniu.microcommonsserver.param.ResponseMsg;
import com.woniu.microownerserver.bean.SearchQuery;
import com.woniu.microownerserver.service.BookService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/book")
public class BookController {
    @Resource
    private BookService bookService;

    @RequestMapping("/getAll")
    public ResponseMsg getAll(SearchQuery searchQuery) throws IOException {
        System.out.println(searchQuery);
        ResponseMsg msg = bookService.searchByQuery(searchQuery);
        System.out.println(msg);
        return msg;
    }
}
